import codecs

def writetxt(url, content, code):
    with codecs.open('F:\\codecs\\a.txt', 'a', encoding=code) as f:
        f.write(content)
    return url + "ok"


if __name__ == '__main__':
    f = codecs.open('F:\codecs\\a.txt', 'a', encoding='utf8')
    f.write('aaaaaaaa')
    f.close()
